﻿using CuaHangLego.DataAccess;
using CuaHangLego.Model;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CuaHangLego.Bussiness.Parser
{
    public class CTHDParser
    {
        public static CTHD Parse(SqlDataReader sdata)
        {
            CTHD ct = new CTHD();
            ct.MaHD = int.Parse(sdata["HoaDonID"].ToString());
            ct.SanPham = SanPhamKhoDA.Instance.GetByID(int.Parse(sdata["SanPhamID"].ToString()));
            ct.SoLuong = int.Parse(sdata["SoLuong"].ToString());
            return ct;
        }
    }
}
